
import { ref, reactive } from "vue";
// cnode社区数据接口
interface TabRequest {
  page: number;
  tab: string;
  limit: number;
}
export const tabParams = reactive({
  page: 1,
  tab: sessionStorage.getItem("tab") || 'all',
  limit: 10,
});
export function upDataParam(val: TabRequest): void {
  tabParams.page = val.page;
  tabParams.tab = val.tab;
  tabParams.limit = val.limit;
}
//详情对象
interface Details {
  data: object;
}
export const detailsItem = reactive({
  data: {}
});
export function upDataDetails(val: Details): void {
  detailsItem.data = val
}

//页码控制
export let Pagination = reactive({
  data: true
});
export function updataPagin(val: boolean): void {
  Pagination.data = val
}

interface user {
  username: string;
  avatar: string;
}
//头像昵称
export let userinfo = reactive({
  username: '' || '聪明的鱼罐头',
  avatar: '' || 'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=234807691,3908950329&fm=26&gp=0.jpg'
});
export function updataUserInfo(val: user): void {
  console.log(val);
  userinfo.username = val.username
  userinfo.avatar = val.avatar
}

